﻿using System;
using System.Diagnostics;
using System.IO;
using System.Net.Sockets;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using TCPServerSocket;

namespace UnitTestProject1
{
    [TestClass]
    public class UnitTest1
    {
        [TestMethod]
        public void TestMethod1()
        {
              var tcp = new TcpServer
              {
                  RecvNewClientAction = handler => Debug.WriteLine("recv new client: " + handler),
                  LostClientAction = handler => Debug.WriteLine("lost client :" + handler),
                  RecvDataAction = (ip, data, len) => Debug.WriteLine("{0}:{1}", ip, Encoding.ASCII.GetString(data, 0, len)),
                  ListenPort = 8080,
                  Ip = "192.168.0.110"
              };
              tcp.StartListen();

              Console.Read();
              tcp.StopListen();


        }

    }
}
